package com.kma.summer2012.model;
// Generated Dec 6, 2012 12:14:41 AM by Hibernate Tools 3.2.1.GA


import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CrumbsProcessHistory generated by hbm2java
 */
@Entity
@Table(name = "CRUMBS_PROCESS_HISTORY"
        , schema = "KMA1"
)
public class CrumbsProcessHistory implements java.io.Serializable {


    private int id;
    private CrumbsUser crumbsUserBySenderId;
    private CrumbsUser crumbsUserByRecieverId;
    private CrumbsRequest crumbsRequest;
    private Date fixedDate;
    private String commentText;

    public CrumbsProcessHistory() {
    }


    public CrumbsProcessHistory(int id, CrumbsUser crumbsUserBySenderId, CrumbsUser crumbsUserByRecieverId, CrumbsRequest crumbsRequest, Date fixedDate) {
        this.id = id;
        this.crumbsUserBySenderId = crumbsUserBySenderId;
        this.crumbsUserByRecieverId = crumbsUserByRecieverId;
        this.crumbsRequest = crumbsRequest;
        this.fixedDate = fixedDate;
    }

    public CrumbsProcessHistory(int id, CrumbsUser crumbsUserBySenderId, CrumbsUser crumbsUserByRecieverId, CrumbsRequest crumbsRequest, Date fixedDate, String commentText) {
        this.id = id;
        this.crumbsUserBySenderId = crumbsUserBySenderId;
        this.crumbsUserByRecieverId = crumbsUserByRecieverId;
        this.crumbsRequest = crumbsRequest;
        this.fixedDate = fixedDate;
        this.commentText = commentText;
    }

    @Id

    @Column(name = "ID", unique = true, nullable = false, precision = 9, scale = 0)
    public int getId() {
        return this.id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @ManyToOne(cascade = {CascadeType.REFRESH, CascadeType.MERGE, CascadeType.PERSIST}, fetch = FetchType.EAGER)
    @JoinColumn(name = "SENDER_ID", nullable = false)
    public CrumbsUser getCrumbsUserBySenderId() {
        return this.crumbsUserBySenderId;
    }

    public void setCrumbsUserBySenderId(CrumbsUser crumbsUserBySenderId) {
        this.crumbsUserBySenderId = crumbsUserBySenderId;
    }

    @ManyToOne(cascade = {CascadeType.REFRESH, CascadeType.MERGE, CascadeType.PERSIST}, fetch = FetchType.EAGER)
    @JoinColumn(name = "RECIEVER_ID", nullable = false)
    public CrumbsUser getCrumbsUserByRecieverId() {
        return this.crumbsUserByRecieverId;
    }

    public void setCrumbsUserByRecieverId(CrumbsUser crumbsUserByRecieverId) {
        this.crumbsUserByRecieverId = crumbsUserByRecieverId;
    }

    @ManyToOne(cascade = {CascadeType.REFRESH, CascadeType.MERGE, CascadeType.PERSIST}, fetch = FetchType.LAZY)
    @JoinColumn(name = "REQUEST_ID", nullable = false)
    public CrumbsRequest getCrumbsRequest() {
        return this.crumbsRequest;
    }

    public void setCrumbsRequest(CrumbsRequest crumbsRequest) {
        this.crumbsRequest = crumbsRequest;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "FIXED_DATE", nullable = false, length = 7)
    public Date getFixedDate() {
        return this.fixedDate;
    }

    public void setFixedDate(Date fixedDate) {
        this.fixedDate = fixedDate;
    }

    @Column(name = "COMMENT_TEXT", length = 1000)
    public String getCommentText() {
        return this.commentText;
    }

    public void setCommentText(String commentText) {
        this.commentText = commentText;
    }


}


